package Morning;

public class Student implements Comparable<Student> {

    String name;
    int age;
    int socer;

    public Student() {
    }

    public Student(String name, int age, int socer) {
        this.name = name;
        this.age = age;
        this.socer = socer;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getSocer() {
        return socer;
    }

    public void setSocer(int socer) {
        this.socer = socer;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", socer=" + socer +
                '}';
    }

    @Override
    public int compareTo(Student o) {
        int a = this.socer - o.socer;

        if (a == 0)
            a = this.getName().compareTo(o.getName());

            return a;

    }

}
